/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.clinicplus.entity;

import br.com.foxline.clinicplus.enums.AdviceProfessional;
import br.com.foxline.clinicplus.enums.Gender;
import br.com.foxline.clinicplus.util.Caracter;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author roniere
 */
@Entity
public class Doctor implements Serializable{
    
    @Id
    @SequenceGenerator(sequenceName = "seq_doctor", name = "seq_doctor", allocationSize = 1)
    @GeneratedValue(generator = "seq_doctor", strategy = GenerationType.SEQUENCE)
    private Long id;
    private String name;
    @Enumerated(EnumType.STRING)
    private Gender gender;
    private String occupation;
    //conselho
    @Enumerated(EnumType.STRING)
    private AdviceProfessional advice;
    private String numberAdvice;
    @ManyToOne
    private Country country;
    
    @ManyToOne
    private Cbo cbo;
    
    @OneToOne(cascade= CascadeType.ALL)
    private Address address;
    private String email;
    private String phone;
    private String cellular;
    
    @OneToOne
    private SystemUser systemUser;
    
  
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date createAt;
    
    private Boolean active;

    public Doctor() {
        active = true;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }
    
    
    
    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }
    
    public Address getAddress() {
        return address;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public AdviceProfessional getAdvice() {
        return advice;
    }

    public void setAdvice(AdviceProfessional advice) {
        this.advice = advice;
    }

    public String getCellular() {
        return cellular;
    }

    public void setCellular(String cellular) {
        this.cellular = cellular;
    }

    public Cbo getCbo() {
        return cbo;
    }

    public void setCbo(Cbo cbo) {
        this.cbo = cbo;
    }

   

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = Caracter.removeCaracterSpecials(name);
    }

    public String getNumberAdvice() {
        return numberAdvice;
    }

    public void setNumberAdvice(String numberAdvice) {
        this.numberAdvice = numberAdvice;
    }

    public String getOccupation() {
        return occupation;
    }

    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

  
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Doctor other = (Doctor) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Doctor{" + "id=" + id + ", name=" + name + ", gender=" + gender + ", occupation=" + occupation + ", advice=" + advice + ", numberAdvice=" + numberAdvice + ", country=" + country + ", cbo=" + cbo + ", address=" + address + ", email=" + email + ", phone=" + phone + ", cellular=" + cellular + ", systemUser=" + systemUser + ", createAt=" + createAt + '}';
    }

    
    
    
    
}
